
local CommonOHOH = _G.CommonOHOH;
local M = CommonOHOH.class.new(script, CommonOHOH.files.CharacterAnimationCtrl());

function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent);

end;

function M.dtor(self)

	M.super.dtor(self);
end;


function M.GetAnimator(self)
	if not self.Animator then
		self.Animator= self.parent:WaitForChild_Loop(("AnimationController.Animator"))
	end
	return self.Animator
end

function M.LoadAnimation(self,animation,id,priority)
	
	if self.Animations[id] then
		return self.AnimationTrack[id]
	end

	if not self.AnimationController then
		self.AnimationController= self.parent:WaitForChild_Loop(("AnimationController"))
	end

	self.Animations[id]=animation
	local animationTrack =self.AnimationController:LoadAnimation(animation)
	self.AnimationTrack[id]=animationTrack

	if priority then
		animationTrack.Priority=priority
	end

	if not self.AnimationTrackLenght[id] and animationTrack.Length>0 then
		self.AnimationTrackLenght[id]=animationTrack.Length
	end

	return animationTrack
end


return M